package com.hjm.friend.controller.user;

import com.hjm.common.core.domain.Result;
import com.hjm.common.core.domain.page.PageDomain;
import com.hjm.common.core.domain.page.TableDataInfo;
import com.hjm.friend.service.user.IUserMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/message")
public class UserMessageController {

    @Autowired
    private IUserMessageService userMessageService;

    @GetMapping("/list")
    public TableDataInfo list(PageDomain page) {
        return userMessageService.selectUserMessageList(page);
    }

//    @GetMapping("/detail")
//    public R<UserMessageVO> detail(Long messageId, Long textId) {
//        return Result.ok(userMessageService.detail(messageId, textId));
//    }

    @DeleteMapping("/delete")
    public Result<?> delete(Long textId) {
        return Result.ok(userMessageService.delete(textId));
    }
}
